package com.keba.lamp.base.entity.common;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.keba.basic.base.entity.Entity;
import lombok.*;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

import static com.keba.lamp.model.constant.Condition.LIKE;

/**
 * <p>
 * 实体类
 * 字典
 * </p>
 *
 * @author zuihou
 * @since 2021-10-21
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("base_dict")
@AllArgsConstructor
public class BaseDict extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 字典ID
     */
    @TableField(value = "parent_id")
    private Long parentId;

    /**
     * 父字典标识
     */
    @TableField(value = "parent_key", condition = LIKE)
    private String parentKey;

    /**
     * 标识
     */
    @TableField(value = "key_", condition = LIKE)
    private String key;

    /**
     * 分类;[10-系统字典 20-业务字典]@Echo(api = EchoApi.DICTIONARY_ITEM_FEIGN_CLASS, dictType = EchoDictType.System.DICT_CLASSIFY)
     */
    @TableField(value = "classify", condition = LIKE)
    private String classify;

    /**
     * 名称
     */
    @TableField(value = "name", condition = LIKE)
    private String name;

    /**
     * 状态
     */
    @TableField(value = "state")
    private Boolean state;

    /**
     * 备注
     */
    @TableField(value = "remark", condition = LIKE)
    private String remark;

    /**
     * 排序
     */
    @TableField(value = "sort_value")
    private Integer sortValue;

    /**
     * 图标
     */
    @TableField(value = "icon", condition = LIKE)
    private String icon;

    /**
     * css样式
     */
    @TableField(value = "css_style", condition = LIKE)
    private String cssStyle;

    /**
     * css类元素
     */
    @TableField(value = "css_class", condition = LIKE)
    private String cssClass;

    /**
     * 创建机构id
     */
    @TableField(value = "created_org_id")
    private Long createdOrgId;


    @Builder
    public BaseDict(Long id, Long createdBy, LocalDateTime createdTime, Long updatedBy, LocalDateTime updatedTime,
                    Long parentId, String parentKey, String key, String classify, String name,
                    Boolean state, String remark, Integer sortValue, String icon, String cssStyle, String cssClass, Long createdOrgId) {
        this.id = id;
        this.createdBy = createdBy;
        this.createdTime = createdTime;
        this.updatedBy = updatedBy;
        this.updatedTime = updatedTime;
        this.parentId = parentId;
        this.parentKey = parentKey;
        this.key = key;
        this.classify = classify;
        this.name = name;
        this.state = state;
        this.remark = remark;
        this.sortValue = sortValue;
        this.icon = icon;
        this.cssStyle = cssStyle;
        this.cssClass = cssClass;
        this.createdOrgId = createdOrgId;
    }

}
